package com.cheetah;

import org.springframework.boot.Banner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@SpringBootApplication(scanBasePackages="com.cheetah",
        exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class} )
@EnableDiscoveryClient
public class ServerApplication {

//    static{
//        System.setProperty("Dapollo.configService","http://192.168.150.132");
//    }

    public static void main(String[] args) {
        new SpringApplicationBuilder()
                .sources(Object.class) //这里之前ServerApplication，导致runner被重复执行
                .child(ServerApplication.class)
                .headless(true)
                .web(WebApplicationType.SERVLET)
                //取消spring启动打印
                .bannerMode(Banner.Mode.OFF)
                .run(args)
                .registerShutdownHook();
    }
}
